﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Repositories;

namespace LiveShopvnext.Books
{
    public class BookAppService:CrudAppService<Book,BookDto,Guid, BookListDto, CreateUpdateBookDto>,IBookAppService
    {
        public BookAppService(IRepository<Book,Guid> repository):base(repository)
        {
            
        }

        [Obsolete]
        protected override IQueryable<Book> CreateFilteredQuery(BookListDto input)
        {
            return base.CreateFilteredQuery(input).WhereIf(!string.IsNullOrEmpty(input.Name),b=>b.Name.Contains(input.Name));
        }
        //[Obsolete]
        //protected override IQueryable<Book> CreateFilteredQuery(BookListDto input)
        //{
        //    return base.CreateFilteredQuery(input).WhereIf(!string.IsNullOrEmpty(input.Name),b=>b.Name.Contains(input.Name));
        //}
    }
}
